@(ditte: List[Ditta], dittaForm: play.data.Form[Ditta],success: Boolean)

@import helper._

	<!-- TOOLTIP -->
	
	<script>
  	$(function() {
    	$( document ).tooltip();
  	});
  	</script>
 
@main("Ditta") {
	
	<table>
	<td>
	@form(routes.Application.home()) {
   		<button type="submit"  class="btn btn-success btn-large"><i class="icon-home"></i> Home</button>
    }
	</td>
   	<td>
   	
   	<p style="-webkit-text-stroke: #000000 1px; font-size: 39px; color:#3ADF00"> Ditta(e)</p>
   	
   	</td>
   	<td>
   	@form(routes.Ditte.newDitta()) {
   		<button type="submit" title="Nuova Ditta" class="btn btn-success btn-large"><i class="icon-plus"></i> </button>
    }
    </td>
    </table>
    
    @if(success==true){
    	<div class="alert alert-success">
  			<button type="button" class="close" data-dismiss="alert">&times;</button>
  			<strong>Tutte le modifiche sono state salvate!</strong>
		</div>
    }
    
    <table class="tablesorter table table-bordered table-hover table-condensed"> 
    
    <thead>
	<tr class="success"><th><b>Nome</b></th><th><b>Tipo</b></th><th><b>Indirizzo</b></th><th><b>Città</b></th><th><b>Telefono</b></th><th><b>Fax</b></th><th><b>Partita Iva</b></th><th><b>Cod. Fiscale</b></th><th><b>Mail</b></th><th><b>Anno</b></th></tr>
   	</thead>
    <tbody> 
        @for(ditta <- ditte) {
        	@if(ditta.anno >= Calendar.getInstance().get(Calendar.YEAR)){
            	<tr class="info"> 
            	
                <td>@ditta.nome</td> <td>@ditta.tipo.etichetta</td> <td>@ditta.indirizzo</td> <td>@ditta.citta</td> <td>@ditta.telefono</td> <td>@ditta.fax</td> <td>@ditta.partitaIva</td> <td>@ditta.codFiscale</td> <td>@ditta.mail</td> <td>@ditta.anno</td>
                
                <td>
                	
  					<div class="btn-group">
    					<a class="btn btn-danger " title="Elimina Ditta" href="@routes.Ditte.deleteDitta(ditta.id)" onclick="return confirm('Are you sure?');"><i class="icon-trash"></i></a>
    					<a class="btn btn-warning " title="Modifica Ditta" href="@routes.Ditte.editDitta(ditta.id)"><i class="icon-pencil"></i></a>
    					<a class="btn btn-info " title="Aggiungi collegamento ad una categoria/classifica" href="@routes.Ditte.aggiungiCategoria(ditta.id)"><i class="icon-plus"></i></a>
    				</div>
               	</td>
             
                
                </tr> 
            }
        }
    </tbody>
    </table>
    
    <div id="pager" class="pager">
	<form> 
	
		<img src="@routes.Assets.at("tablesorter/addons/pager/first.png")" class="first"/>
		<img src="@routes.Assets.at("tablesorter/addons/pager/prev.png")" class="prev"/>
		<input type="text" class="pagedisplay"/>
		<img src="@routes.Assets.at("tablesorter/addons/pager/next.png")" class="next"/>
		<img src="@routes.Assets.at("tablesorter/addons/pager/last.png")" class="last"/>
		
		
		<select class="pagesize" style="width: 60px">
			<option selected="selected"  value="10">10</option>
			<option value="20">20</option>
			<option value="30">30</option>
			<option  value="40">40</option>
		</select>
	
	</form>
	
	</div>
}